//
//  LoginViewCtrl.m
//  OrderSys
//
//  Created by JM on 15/10/5.
//  Copyright © 2015年 zjlskj. All rights reserved.
//

#import "LoginViewCtrl.h"
#import "RegisterViewCtrl.h"

typedef void (^ResignerSucessHandleBlock)(void);

@interface LoginViewCtrl ()
@property (copy, nonatomic) LoginSucessHandleBlock successBlock ;
@end

@implementation LoginViewCtrl

+ (id) presentInViewCtrl:(UIViewController *) vc withSucessHandle:(ResignerSucessHandleBlock) ablock animal:(BOOL) animal{
    LoginViewCtrl * vcLogin = [[LoginViewCtrl alloc] init];
    vcLogin.successBlock = ablock;
    [vc presentViewController:vcLogin animated:YES completion:^{
        
    }];
    return vcLogin;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)clickBtnLogin:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        if (self.successBlock) {
            self.successBlock();
        }
    }];
}

- (IBAction)clickBtnResigner:(id)sender {
    RegisterViewCtrl * viewCtrl = [[RegisterViewCtrl alloc] init];
    UINavigationController * naviViewCtrl = [[UINavigationController alloc] initWithRootViewController:viewCtrl];
    [self presentViewController:naviViewCtrl animated:YES completion:^{
        
    }];
}

- (IBAction)clickBtnCancle:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
    }];
}
@end
